#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

void fun(int num)
{
	int sum = 0;
	int temp = num;
	for (int i = 0; i < 5; i++)
	{
		sum += num;
		num = num * 10 + temp;
	}
	printf("%d\n", sum);
}

int main()
{
	int Num = 0;
	scanf("%d", &Num);

	fun(Num);

	return 0;
}